<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue</title>
</head>
<body>
<!-- 视图 -->
<div id="div">
    <div>姓名：{{name}}</div>
    <div>班级：{{classRoom}}</div>
    <button onclick="hi()">打招呼</button>
    <button onclick="update()">修改班级</button>
</div>
</body>
    <script src="js/vue.js"></script>
    <script>
        //脚本
        let vm = new Vue({
            el:"#div",
            data:{
                name:"大",
                classRoom:"鸡巴"
            },
            methods:{
                work(){
                 alert(this.name+this.classRoom);
                }
            }
        });


        function hi(){
          vm.work();
        }

        function  update(){
            vm.classRoom="黄瓜";
        }
    </script>
</html>